Skip to content

Fix duplicate docstring attributes in Measurement and Exemplar classes#4920

Merged
xrmx merged 2 commits intoopen-telemetry:mainfrom
chimchim89:fix-duplicate-docstring-attributes
Mar 13, 2026
Merged

Fix duplicate docstring attributes in Measurement and Exemplar classes#4920
xrmx merged 2 commits intoopen-telemetry:mainfrom
chimchim89:fix-duplicate-docstring-attributes

Conversation

@chimchim89
Copy link
Contributor

@chimchim89 chimchim89 commented Feb 18, 2026

Description

Fixes the duplicate attribute documentation caused by both napoleon and autodoc Sphinx extensions processing the same Attributes: sections in dataclass docstrings. This was flagged by TODO comments in both files referencing sphinx-doc/sphinx#8664.

Changes:

  • docs/conf.py: Add napoleon_use_ivar = True so napoleon emits :ivar: fields instead of .. attribute:: directives, preventing autodoc from rendering the same attributes a second time
  • measurement.py: Fix missing colon in Attributes: section and remove TODO comment
  • exemplar.py: Fix missing colon in Attributes: section and remove TODO comment

Fixes # (no issue — fixing existing TODO comments in the codebase)

Type of change

  • This change requires a documentation update

How Has This Been Tested?

Ran tox -e docs and tox -e ruff locally.

  • tox -e ruff passes cleanly after auto-fix of trailing whitespace
  • tox -e docs fails on both main and this branch with the same pre-existing unrelated error in opentelemetry._logs._internal.LogRecord (ambiguous cross-reference for Context). This is not caused by this PR.

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@chimchim89 chimchim89 requested a review from a team as a code owner February 18, 2026 10:26
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 18, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: xrmx / name: Riccardo Magliocchetti (f7ae6fd)

@tammy-baylis-swi tammy-baylis-swi added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Feb 18, 2026
Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Maintainers will also review

@tammy-baylis-swi tammy-baylis-swi moved this to Ready for review in Python PR digest Feb 18, 2026
@tammy-baylis-swi tammy-baylis-swi moved this from Ready for review to Easy to review / merge / close in Python PR digest Feb 26, 2026
@MikeGoldsmith MikeGoldsmith moved this from Easy to review / merge / close to Approved PRs in Python PR digest Feb 27, 2026
@xrmx xrmx enabled auto-merge (squash) March 13, 2026 08:30
@xrmx xrmx merged commit 9d90db4 into open-telemetry:main Mar 13, 2026
460 of 461 checks passed
@github-project-automation github-project-automation bot moved this from Approved PRs to Done in Python PR digest Mar 13, 2026
@chimchim89 chimchim89 deleted the fix-duplicate-docstring-attributes branch March 13, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants